CFLAGS= build/libraylib.a -Wall -lGL -lm -lpthread -ldl -lrt -lX11
OBJECTS = $(patsubst src/%.c, build/%.o, $(wildcard src/*.c))

build: ${OBJECTS}
	gcc ${OBJECTS} ${CFLAGS} -o chicken_go_splat.x86_64

build/main.o: src/main.c
	gcc -c -Wall src/main.c -o build/main.o

build/renderer.o: src/renderer.c
	gcc -c -Wall src/renderer.c -o build/renderer.o

build/cars.o: src/cars.c
	gcc -c -Wall src/cars.c -o build/cars.o

build/players.o: src/players.c
	gcc -c -Wall src/players.c -o build/players.o

build/menu.o: src/menu.c
	gcc -c -Wall src/menu.c -o build/menu.o

build/image_loading.o: src/image_loading.c src/images.h
	gcc -c -Wall src/image_loading.c -o build/image_loading.o

build/sound_loading.o: src/sound_loading.c src/sounds.h
	gcc -c -Wall src/sound_loading.c -o build/sound_loading.o

clean:
	rm build/*.o
